package net.zdsoft.wpchat.support.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 对结果集打包的实体类
 *
 * @author xuan
 */
public class ResultPack {
    private String[] columnNames = null;
    private List<String[]> records = null;

    public ResultPack() {
        records = new ArrayList<String[]>();
    }

    public void setColumnNames(String[] columnNames) {
        this.columnNames = columnNames;
    }

    public String[] getColumnNames() {
        return columnNames;
    }

    public List<String[]> getRecords() {
        return records;
    }

    public int getColumnCount() {
        return columnNames.length;
    }

    public void addRecord(String[] record) {
        if (columnNames.length == record.length) {
            records.add(record);
        }
    }

}
